{$CLEO}
0000:
thread 'StIco'
    wait 0
    
    // 0xA0FD08 - sceen height
    05E0: 1@ = read_memory 0xA0FD08 size 4 virtual_protect 0
    
    // proportionality top margin's
    0087: 9@ = 1@
    9@ /= 100
    9@ *= 10
    0093: 9@ = int_to_float 9@
    
    // proportionality sprites size's    
    1@ /= 6
    1@ /= 1
    0093: 1@ = int_to_float 1@
    0087: 2@ = 1@
    
    // available only in CLEO 2.0.0.4
    0AF2: read_float_from_ini_file "cleo\radioStation.ini" section "IconsParams" key "size" store_to 10@

    if
        10@ > 0
    then
        0087: 1@ = 10@
        0087: 2@ = 10@
    end

    0AF2: read_float_from_ini_file "cleo\radioStation.ini" section "IconsParams" key "margin" store_to 10@

    if
        10@ > 0
    then
        0087: 9@ = 10@
    end
        
    3@ = 0                         // top margin value
    3@ -= 9999.0                   // because we can't write negative value in opcode
    
    // 0x6CD9C8 - top margin in pixels (float)
    05DF: write_memory 0x6CD9C8 size 4 value 3@ virtual_protect 0 // hide radiostations' names
    
    :checking
    wait 0
    0391: release_textures
    
    // 0xA0FD04 - screen width
    05E0: 0@ = read_memory 0xA0FD04 size 4 virtual_protect 0
    0014: 0@ /= 2 
    008D: 0@ = integer_to_float 0@ // coordinates is float always
    
    // load textures (works in Vice City, but never used)
    0390: load_txd_dictionary 'radio'
    038F: load_texture 'wild' as  1
    038F: load_texture 'flash' as 2
    038F: load_texture 'kchat' as 3
    038F: load_texture 'fever' as 4
    038F: load_texture 'vrock' as 5
    038F: load_texture 'vcpr' as  6
    038F: load_texture 'espan' as 7
    038F: load_texture 'emoti' as 8
    038F: load_texture 'wave' as  9
    038F: load_texture 'player' as  10
    
    03F0: enable_text_draw 1
    03E3: set_texture_to_be_drawn_antialiased 1
    
    while 80E0: not player $PLAYER_CHAR driving 
        wait 0
    end
    
    03C1: 4@ = player $PLAYER_CHAR car_no_save 
    05E7: 5@ = car 4@ struct
    5@ += 0x23C // corrent radiostation ID
    
    while true
        wait 0
        if or
            00DE: player $PLAYER_CHAR driving_vehicle_type #POLICE 
            00DE: player $PLAYER_CHAR driving_vehicle_type #RHINO 
            00DE: player $PLAYER_CHAR driving_vehicle_type #FBICAR 
            00DE: player $PLAYER_CHAR driving_vehicle_type #FIRETRUK 
            00DE: player $PLAYER_CHAR driving_vehicle_type #BARRACKS 
            00DE: player $PLAYER_CHAR driving_vehicle_type #ENFORCER 
            00DE: player $PLAYER_CHAR driving_vehicle_type #ENFORCER 
            00DE: player $PLAYER_CHAR driving_vehicle_type #VICECHEE
        then
            continue 
        else if
            00DE: player $PLAYER_CHAR driving_vehicle_type #AMBULAN
            then
                continue 
            else
                break
            end
        end
    end
    
    05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
   
    if
        6@ == 0
    then
        01BD: 7@ = current_time_in_ms
        while 6@ == 0
            wait 0
            038D: draw_texture 1 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
            05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
            01BD: 8@ = current_time_in_ms
            0062: 8@ -= 7@
            if
                8@ >= 2000
            then
                while 6@ == 0
                    wait 0
                    if
                        80E0:   not player $PLAYER_CHAR driving
                    then
                        jump @checking
                    end
                    05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                end
                jump @checking  
            end
        end
    else
        if
            6@ == 1
        then
            01BD: 7@ = current_time_in_ms            
            while 6@ == 1
                wait 0
                038D: draw_texture 2 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                          
                01BD: 8@ = current_time_in_ms
                0062: 8@ -= 7@
                if
                    8@ >= 2000
                then
                    while 6@ == 1
                        wait 0
                        if
                            80E0:   not player $PLAYER_CHAR driving
                        then
                            jump @checking
                        end
                        05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                    end
                    jump @checking  
                end
            end
        else
            if
                6@ == 2
            then
                01BD: 7@ = current_time_in_ms
                while 6@ == 2
                    wait 0
                    038D: draw_texture 3 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                    05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                        
                    01BD: 8@ = current_time_in_ms
                    0062: 8@ -= 7@
                    if
                        8@ >= 2000
                    then
                        while 6@ == 2
                            wait 0
                            if
                                80E0:   not player $PLAYER_CHAR driving
                            then
                                jump @checking
                            end
                            05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                        end
                        jump @checking  
                    end
                end
            else
                if
                    6@ == 3
                then
                    01BD: 7@ = current_time_in_ms
                    while 6@ == 3
                        wait 0
                        038D: draw_texture 4 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                        05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                        
                        01BD: 8@ = current_time_in_ms
                        0062: 8@ -= 7@
                        if
                            8@ >= 2000
                        then
                            while 6@ == 3
                                wait 0
                                if
                                    80E0:   not player $PLAYER_CHAR driving
                                then
                                    jump @checking
                                end
                                05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                            end
                            jump @checking  
                        end
                    end
                else
                    if
                        6@ == 4
                    then
                        01BD: 7@ = current_time_in_ms
                        while 6@ == 4
                            wait 0
                            038D: draw_texture 5 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                            05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                        
                            01BD: 8@ = current_time_in_ms
                            0062: 8@ -= 7@
                            if
                                8@ >= 2000
                            then
                                while 6@ == 4
                                    wait 0
                                    if
                                        80E0:   not player $PLAYER_CHAR driving
                                    then
                                        jump @checking
                                    end
                                    05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                                end
                                jump @checking  
                            end
                        end
                    else
                        if
                            6@ == 5
                        then
                            01BD: 7@ = current_time_in_ms
                            while 6@ == 5
                                wait 0
                                038D: draw_texture 6 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                                05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                       
                                01BD: 8@ = current_time_in_ms
                                0062: 8@ -= 7@
                                if
                                    8@ >= 2000
                                then
                                    while 6@ == 5
                                        wait 0
                                        if
                                            80E0:   not player $PLAYER_CHAR driving
                                        then
                                            jump @checking
                                        end
                                        05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                                    end
                                    jump @checking  
                                end
                            end
                        else
                            if
                                6@ == 6
                            then
                                01BD: 7@ = current_time_in_ms
                                while 6@ == 6
                                    wait 0
                                    038D: draw_texture 7 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                                    05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                        
                                    01BD: 8@ = current_time_in_ms
                                    0062: 8@ -= 7@
                                    if
                                        8@ >= 2000
                                    then
                                        while 6@ == 6
                                            wait 0
                                            if
                                                80E0:   not player $PLAYER_CHAR driving
                                            then
                                                jump @checking
                                            end
                                            05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                                        end
                                        jump @checking  
                                    end
                                end
                            else
                                if
                                    6@ == 7
                                then
                                    01BD: 7@ = current_time_in_ms
                                    while 6@ == 7
                                        wait 0
                                        038D: draw_texture 8 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                                        05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                       
                                        01BD: 8@ = current_time_in_ms
                                        0062: 8@ -= 7@
                                        if
                                            8@ >= 2000
                                        then
                                            while 6@ == 7
                                                wait 0
                                                if
                                                    80E0:   not player $PLAYER_CHAR driving
                                                then
                                                    jump @checking
                                                end
                                                05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                                            end
                                            jump @checking  
                                        end
                                    end
                                else
                                    if
                                        6@ == 8
                                    then
                                        01BD: 7@ = current_time_in_ms
                                        while 6@ == 8
                                            wait 0
                                            038D: draw_texture 9 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                                            05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                        
                                            01BD: 8@ = current_time_in_ms
                                            0062: 8@ -= 7@
                                            if
                                                8@ >= 2000
                                            then
                                                while 6@ == 8
                                                    wait 0
                                                    if
                                                        80E0:   not player $PLAYER_CHAR driving
                                                    then
                                                        jump @checking
                                                    end
                                                    05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                                                end
                                                jump @checking  
                                            end
                                        end
                                    else
                                        if
                                            6@ == 9
                                        then
                                            01BD: 7@ = current_time_in_ms
                                            while 6@ == 9
                                                wait 0
                                                038D: draw_texture 10 position 0@ 9@ scale 1@ 2@ RGBA 255 255 255 200
                                                05E0: 6@ = read_memory 5@ size 1 virtual_protect 0                                                                        
                                                01BD: 8@ = current_time_in_ms
                                                0062: 8@ -= 7@
                                                if
                                                    8@ >= 2000
                                                then
                                                    while 6@ == 9
                                                        wait 0
                                                        if
                                                            80E0:   not player $PLAYER_CHAR driving
                                                        then
                                                            jump @checking
                                                        end
                                                        05E0: 6@ = read_memory 5@ size 1 virtual_protect 0
                                                    end
                                                    jump @checking  
                                                end
                                            end
                                        end
                                    end
                                end
                            end
                        end                                               
                    end
                end
            end
        end 
    end
    jump @checking
end_thread